<div class="categories form">
<?php echo $this->Form->create('Category'); ?>
	<fieldset>
		<legend><?php echo __('Edit Category'); ?></legend>
                <div class="input text required">
                    <label for="Category">Parent</label>
                    <select required="required" id="Category" name="data[Category][parent_id]">
                        <?php
                          foreach($categories as $category){
                               ?> <option value="<?php echo $category['Category']['id']; ?>">
                                   <?php
                                echo $category['Category']['name'];?> 
                               </option> <?php
                            }
                        ?>
                   
                    </select>
                </div>
	<?php
      
		echo $this->Form->input('name');
		
	?>
	</fieldset>
<?php echo $this->Form->end(__('Submit')); ?>
</div>
<div class="actions">
	<h3><?php echo __('Actions'); ?></h3>
	<ul>

		<li><?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $this->Form->value('Category.id')), null, __('Are you sure you want to delete # %s?', $this->Form->value('Category.id'))); ?></li>
		<li><?php echo $this->Html->link(__('List Categories'), array('action' => 'index')); ?></li>
	</ul>
</div>
